﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<SDT.Site.ViewModels.CompanyListModels>" %>
<div class="bor_cor">
<div class="city_hd">
   <div class="city_hdl">
        <h4><span>Doanh nghiệp BĐS ở các tỉnh/thành</span></h4> 
   </div>
   <div class="city_hdr">
        <h4><span onclick="ShowDialog('dialogCity');">Xem tất cả&raquo;</span></h4> 
   </div>
   <div class="clear"></div>
</div>
<div class="line" style="border-bottom: 1px solid #999; margin-top:0px"></div>
<div class="city_list">
    <ul>
    <%int index = 0;
        foreach (var item in Model.Cities)
      {
          index += 1;
          if (index == 13) break;
          var path = string.Format("/company/directories/{0}/{1}/{2}",
                     Model.CompanyTypeID,
                     item.ID,
                     Model.DistrictID);
          var css =Model.CityID == item.ID ? "act" : string.Empty;
          if (Model.Keyword != null && Model.Keyword != string.Empty) path = path + "?key=" + Model.Keyword;
          %>
      <li><a href="<%=path %>" class="<%=css %>"><%=Html.Encode(item.Name) %></a></li>
    <%} %>
    </ul>
</div>
</div>
<div class="clear"></div>
<div id="citylist">
    <div id="dialogCity" title="Doanh nghiệp BĐS ở các tỉnh/thành">
       <div class="city_list">
        <ul>
            <%index = 0;
                foreach (var item in Model.Cities)
              {
                  index += 1;
                  if (index == 13) break;
                  var path = string.Format("/company/directories/{0}/{1}/{2}",
                             Model.CompanyTypeID,
                             item.ID,
                             Model.DistrictID);
                  var css =Model.CityID == item.ID ? "act" : string.Empty;
                  if (Model.Keyword != null && Model.Keyword != string.Empty) path = path + "?key=" + Model.Keyword;
                  %>
              <li><a href="<%=path %>" class="<%=css %>"><%=Html.Encode(item.Name) %></a></li>
            <%} %>
        </ul>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function() {
    $("#dialogCity").dialog({
            bgiframe: true,
            autoOpen: false,
            width: 580,
            modal: true
        });
    });    
</script>